<?
require_once($_SERVER["DOCUMENT_ROOT"]."/framework/config.php");
require_once(_FRAMEWORK."/core.php");
require_once(_MODULES."/External/module.facebook.php");
require_once(_MODULES."/External/module.twitter.php");

/// @brief Define Core class 
/// @author ggugi
/// @params 
/// @return 
class FRIENDS extends CORE{
	protected $facebook;
	protected $twitter;
	public function __construct(){
		$this->default_service = "view_friends_index";
		$this->facebook = new API_FACEBOOK();
		$this->twitter = new API_Twitter();
		parent::init();
		if(empty($this->m_idx)){
			header("location:/index.php");
		} 

        if ( preg_match('/iPhone|Android|SAMSUNG|SCH-|SPH-|SGH-|LG-|CANU|IM-|EV-|Nokia|BlackBerry/',$_SERVER['HTTP_USER_AGENT'])  && empty($_REQUEST["service"])) { 
                         header("location:/paper.php?service=view_mobile_index" );
                         exit();
        }    
		parent::execute();
	}
	 
	/// @brief 리스트 페이지 
	/// @author ggugi
	/// @params 
	/// @return 
	protected function view_friends_index(){
		$objData = $this->params;
		$objData["m_idx"] = $this->m_idx;
		$this->model->get_member_info($objData);
		$this->model->get_external_info($objData);
		$this->model->get_timeline_count($objData);
		return $objData;
	}

	/// @brief 리스트 페이지 
	/// @author ggugi
	/// @params 
	/// @return 
	protected function api_get_friends(){
		$objData = $this->params;
		$this->model->get_friends($objData);
		return parent::setResult(true,$objData["friends"]);
	}

}



$_instance= new FRIENDS();

